Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: better expose HTTP Error header information in error handling on write #745

Merged
merged 9 commits into from
Aug 6, 2024

Conversation

karel-rehor
Copy link
Contributor

@karel-rehor karel-rehor commented Aug 1, 2024

Proposed Changes

Http Headers are already part of InfluxException. In the WriteApi they can be accessed with an EventListener. With WriteApiBlocking they get thrown in write method calls.

  • print selected headers useful for debugging to error logs
  • add an example of working with headers from InfluxException

Note that Cloud v3 and OSS v2 handle exceptional streamed or batched data on the server side a little bit differently. It appears that with v3 cloud batches of data that include some invalid records along with valid ones, will still write the valid records and return a success HTTP status code. OSS v2 on the other hand returns an error status triggering an exception.

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • mvn test completes successfully
  • Commit messages are conventional
  • Sign CLA (if not already signed)

@codecov-commenter
Copy link

codecov-commenter commented Aug 1, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.50%. Comparing base (7b39e0c) to head (3824efe).
Report is 9 commits behind head on master.

Files Patch % Lines
.../influxdb/client/write/events/WriteErrorEvent.java 77.77% 1 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #745      +/-   ##
============================================
- Coverage     88.51%   88.50%   -0.02%     
+ Complexity      786      785       -1     
============================================
  Files           174      174              
  Lines          7195     7203       +8     
  Branches        405      405              
============================================
+ Hits           6369     6375       +6     
- Misses          696      697       +1     
- Partials        130      131       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@karel-rehor karel-rehor marked this pull request as draft August 5, 2024 08:06
Copy link
Contributor

@bednar bednar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@karel-rehor karel-rehor marked this pull request as ready for review August 5, 2024 14:25
@karel-rehor karel-rehor merged commit 9ab894c into master Aug 6, 2024
10 checks passed
@karel-rehor karel-rehor deleted the feat/httpErrorHeaders branch August 6, 2024 15:13
@bednar bednar added this to the 7.2.0 milestone Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants